(use-modules (gnu) (gnu system nss))
(use-service-modules desktop sound xorg)

(use-package-modules bootloaders 
admin
freedesktop 
web-browsers 
certs
gnupg
xdisorg 
emacs 
fonts 
vim
password-utils 
text-editors 
ghostscript 
fontutils
haskell-apps
pulseaudio 
tmux
jami
base 
suckless 
wm
gimp 
version-control
kde 
xorg 
gnuzilla 
emacs-xyz 
audio
video 
music
visidata 
terminals
telephony
inkscape
libreoffice 
chromium)


(define-public %emacs/evil-layer
	(map (compose list specification->package+output)
	 	'("emacs-evil"
		"emacs-evil-collection"
		"emacs-evil-magit"
		"emacs-evil-org"
		"emacs-lispy"
		"emacs-dired-hacks"
		"emacs-lispyville")))

(define-public %emacs/core-layer
	(map (compose list specification->package+output)
	 	'("emacs"
		"emacs-guix"
		"emacs-pdf-tools"
		"emacs-circe"
		"emacs-paredit")))

(define-public %emacs/python-layer
	(map (compose list specification->package+output)
	 	'(
		"emacs-elpy")))

(define-public %emacs/guile-layer
	(map (compose list specification->package+output)
	 	'("emacs-geiser"
		"emacs-flycheck-guile")))

(define-public %i3wm-packages
	(map (compose list specification->package+output)
		'("i3-wm"
		"i3status"
		"dmenu"
		"st")))

(define-public %browser-packages
	(map (compose list specification->package+output)
		'("nyxt"
		;;"nomad"
		"qutebrowser"
		"icecat"
		"ungoogled-chromium")))

(define-public %terminal-packages
	(map (compose list specification->package+output)
		'("visidata"
		"asciinema"
		"nnn"
		"udiskie"
		"password-store"
		"shroud"
		"emacs-shroud"
		"tmux"
		"gnupg"
 		"darcs"
		"git"
		"xclip"
		;;(list git "send-email")
		"redshift"
		"rsync"
		"sl"
		"wget"
		"curl"
		"htop"
		"unzip"
		"vim")))

(define-public %multimedia-packages
	(map (compose list specification->package+output)
		'("mpv"
		"ffmpeg"
		"jack"
		"pavucontrol"
		"sox"
		"audacity"
		"ardour")))

(define-public %font-packages
	(map (compose list specification->package+output)
		'("fontconfig"
		"glibc-locales"
		"gs-fonts"
		"font-google-noto"
		"font-dejavu"
		"font-gnu-freefont")))

(define-public %graphicdesign-packages
	(map (compose list specification->package+output)
		'("libreoffice"
		"inkscape"
		"gimp"
		#|"krita"|#)))

(define-public %misc-packages
	(map (compose list specification->package+output)
		'("nss-certs")))

(define-public %audioprogramming-packages
	(map (compose list specification->package+output)
		'("pd"
		"supercollider")))

(define-public %communication-packages
	(map (compose list specification->package+output)
		'("jami"
		;;"gomuks"
		;;"fractal"
		"mumble")))

(define-public %guiledev-packages
	(map (compose list specification->package+output)
		'("guile-colorized"
		"guile-picture-language"
		"guile-ncurses"
		"haunt")))

(define-public %emacs-packages
	(append %emacs/guile-layer
		%emacs/core-layer
		%emacs/evil-layer
		%emacs/python-layer))


(define-public %my-packages
	(append %base-packages
		%i3wm-packages
		%terminal-packages
		%browser-packages
		%emacs-packages
		%font-packages
		%audioprogramming-packages
		%communication-packages
		%multimedia-packages
		%graphicdesign-packages
		%misc-packages
		%guiledev-packages))

	
(operating-system
  (host-name "mango")
  (timezone "America/New_York")
  (locale "en_US.utf8")

   (bootloader (bootloader-configuration
                (bootloader grub-bootloader)
		(timeout 1)
                (target "/dev/sda")))

  (file-systems (append
                 (list (file-system
                         (device (file-system-label "mango-root"))
                         (mount-point "/")
                         (type "ext4")))
                 %base-file-systems))

  (users (cons (user-account
                (name "ccao")
                (comment "Carla Cao")
                (group "users")
                (supplementary-groups '("wheel" "netdev"
                                        "audio" "video")))
               %base-user-accounts))


(packages %my-packages)

(services (cons* (service xfce-desktop-service-type)
                 %desktop-services))

  ;; Allow resolution of '.local' host names with mDNS.
  (name-service-switch %mdns-host-lookup-nss))

;; (map service '(gnome-desktop-service-type xfce-desktop-service-type mate-desktop-service-type))
